In recent years, development of an optical disc as a recording medium of a large capacity has been progressed. For example, a CD (Compact Disc) on which music information has been recorded, a CD-ROM in which data for a computer is recorded, a DVD (Digital Versatile Disc or Digital Video Disc) which handles video information, and the like are known.
The optical discs mentioned here are read only discs. In recent years, an optical disc on which data can be additionally written once or data can be rewritten like a CD-R (CD-Recordable) disc, a CD-RW (CD-Rewritable) disc, or the like has been put into practical use. Further, development of various optical discs such as double density CD whose recording capacity is increased while keeping a shape similar to that of a CD, CD2 in which an affinity of both of an ordinary CD player and a personal computer can be enhanced, and the like has been progressed.
The optical disc of CD2 has an area on the inner rim side and an area on the outer rim side. In the area on the inner rim side, for example, audio data has been recorded in a format similar to that of an ordinary CD-DA (CD digital Audio) so that it can be also reproduced by the ordinary CD player. In the area on the outer rim side, in order to realize an affinity with the personal computer, contents data is filed and recorded on the basis of the specification of the CD-ROM.
A method of recording contents data of a multimedia comprising the audio data and image data onto such an optical disc of CD2 in accordance with the specification of MPEG2-PS is considered. As a compression system of the audio data, for example, use of ATRAC3 is considered.
As a compression system of the audio data, there are known: a subband system in which the inputted audio data in the time base direction is divided into a plurality of bands by a band dividing filter and compression encoded; a transform encoding system in which the inputted audio data in the time base direction is transformed into data in the frequency base direction by an orthogonal function such as a DCT or the like and compression encoded; and a hybrid system in which both of those systems are combined. ATRAC3 is an audio compression system which belongs to the hybrid system. In ATRAC3, the audio data cut out by a predetermined time window is band divided and MDCT transformed, so that the compression encoding is executed.
When a sampling frequency of the audio data is assumed to be, for instance, 44.1 kHz and a time window is assumed to be, for instance, 11.6 msec, the audio data of 512 samples is cut out by such a time window. Assuming that one sample consists of 16 bits, the encoding is executed every 2048 bytes. In ATRAC3, since adaptive bit allocation is performed, it is possible to arbitrarily cope with a bit rate. When a transmission bit rate is equal to 66 kbps, one encode unit is compressed to 192 bytes. When the transmission bit rate is equal to 105 kbps, one encode unit is compressed to 304 bytes. When the transmission bit rate is equal to 132 kbps, one encode unit is compressed to 384 bytes.
In CD-ROM Mode-1, a subcode block consisting of 98 frames is set to a sector and data is recorded on a sector unit basis. A size of one sector is equal to 2352 bytes and a data recording capacity among them is equal to 2048 bytes. In the case of recording the stream of MPEG2-PS, a PES header of a packet layer is added to the data and, further, a pack header is added to a pack layer.
In the specification of MPEG2-PS, stuffing can be performed to the pack header. A padding packet can be inserted. That is, when an edit is performed or the like, there is a case where the recording data is dropped. There is also a case where an amount of data which is stored into one packet differs in accordance with circumstances of encoding. In such a case, to make a data length constant, the stuffing is inserted into the pack header or the padding packet is inserted.
However, if the stuffing bytes of the pack header are used, a length of header is not constant and a problem such that the start position of the packet data and the information of the PES packet cannot be easily detected.
That is, as shown in FIG. 35A, if no stuffing is inserted to the pack header, although a length in a range from the head of one pack to the head of the data of the packet is equal to LA1, when the stuffing is performed to the pack header, the length in the range from the head of one pack to the head of the data of the packet is equal to LA2. As mentioned above, if the stuffing is performed to the pack header, since the length in the range from the head of one pack to the head of the data of the packet changes, it is difficult to detect the head of the data of the packet on the basis of the length in the range from the head of one pack to the head of the data of the packet.
For example, a scrambling control flag has been described in the PES header. If the data has been encrypted in order to protect the contents, first, it is necessary to detect the scrambling control flag.
If the pack header is set to a fixed length, the scrambling control flag is certainly located at a position that is away from the head of one pack by a desired number. Therefore, the scrambling control flag can be immediately obtained by extracting the information at the position that is away from the head of one pack by a desired length.
However, as shown in FIG. 36A, if a mode to perform the stuffing to the pack header is set, although a length in a range from the head of one pack to the scrambling control flag is equal to LB1 when no stuffing is performed, by performing the stuffing to the pack header, as shown in FIG. 36B, the length in the range from the head of one pack to the scrambling control flag is equal to LB2. As mentioned above, if the mode to perform the stuffing to the pack header is set, since the length in the range from the head of one pack to the scrambling control flag changes, it is difficult to detect the scrambling control flag on the basis of the length from the head of one pack.
As mentioned above, the stuffing of the pack header causes a problem such that the header is set to a variable length and it is impossible to detect the start position of the packet data or the information of the PES packet on the basis of the length from the pack header.
As shown in FIG. 37, as a PES header, it is necessary to provide a packet start code of 32 bits and a packet length of 16 bits for the padding packet. Therefore, the padding packet has a data length of at least 6 bytes. In the padding packet, the padding or stuffing of the number of bits smaller than 6 bytes cannot be performed.
As shown in FIG. 37, only the packet start code and the packet length are described in the PES header of the padding packet, and various information such as a scrambling control flag and the like cannot be described. Therefore, the scrambling control depends on the previous PES packet.
Therefore, as shown in FIG. 38, if the previous packet has been encrypted, according to the padding packet, it is encrypted together with the PES header. However, if the PES header of the padding packet is encrypted, there is a possibility such that the start position and length of the padding packet are unclear and the correct decoding cannot be performed.
It is, therefore, an object of the invention to provide a data recording medium, data recording method and apparatus, and data transmitting method and apparatus, in which a length of header can be fixed and the head of the data and the position of the scrambling control flag can be easily detected.
Another object of the invention is to provide a data recording medium, data recording method and apparatus, and data transmitting method and apparatus, in which stuffing and padding of a small number of bits can be performed and no trouble of encryption occurs.